package com.controller;

public class NutritonFacts {
    private Integer servingSize;
    private Integer servings;
    private Integer fat;
    private Integer sodium;

    private NutritonFacts(Builder builder){
        servingSize = builder.servingSize;
        servings = builder.servings;
        fat = builder.fat;
        sodium = builder.sodium;
    }

    public static class Builder{
        private Integer servingSize;
        private Integer servings;
        private Integer fat;
        private Integer sodium;

        public Builder(Integer servingSize, Integer servings){
            this.servingSize = servingSize;
            this.servings = servings;
        }

        public Builder setFat(Integer value){
            this.fat = value;
            return this;
        }

        public Builder setSodium(Integer value){
            this.sodium = value;
            return this;
        }

        public NutritonFacts build(){
            return new NutritonFacts(this);
        }
    }

    @Override
    public String toString() {
        return "NutritonFacts{" +
                "servingSize=" + servingSize +
                ", servings=" + servings +
                ", fat=" + fat +
                ", sodium=" + sodium +
                '}';
    }
}
